def strTest1():
    str = "The quick brown fox 012345"
    alphas = digits = spaces = 0

    for i in str:
        if i.isalpha:
            alphas = alphas+1
        if i.isdigit():
            digits = digits+1
        if i.isspace():
            spaces = spaces+1
    print alphas
    print digits
    print spaces
    pass

def outputFormatting():
    teams = {
      0: ("Ajax Amsterdam", "Inter Milano"),
      1: ("Real Madrid", "AC Milano"),
      2: ("Dortmund", "Sparta Praha")
    }

    results = ("2:3", "3:3", "2:1")

    for i in teams:
        print teams[i][0].ljust(16) + "-".ljust(5) + \
            teams[i][1].ljust(16) + results[i].ljust(3)

    pass

def otherStrFcts():
    print 'There are %d oranges in the basket' % 32
    print 'a = %d  sowie b = %d' %(14, 15)
    print 'Height: %f %s' % (172.3, 'cm')
    print 'Height: %.1f %s' % (172.3, 'cm')
    # hexadeximal
    print "%x" % 300
    print "%#x" % 300
    # octal
    print "%o" % 300
    # scientific
    print "%.1e" % 300000

def printATable():
    # terrible output:
    for x in range(1,6):
        print '%d %d %d' % (x, x*x, x*x*x)

    # nice output
    for x in range(1,6):
        print '%4d %4d %4d' % (x, x*x, x*x*x)

def strIntConversions():
    print str(3), "alphas"

def boolTest():
    print not False
    print not True
    print not ( 4 < 3 )

    x = 10
    y = 0
    if (y != 0 and x/y < 100):
        print "a small value"
    else:
        print "garr"

def simpleWxTestWithMask():
    import wx

    app = wx.App()
    window = wx.Frame(None, style=wx.MAXIMIZE_BOX | wx.RESIZE_BORDER
        | wx.SYSTEM_MENU | wx.CAPTION |	 wx.CLOSE_BOX)
    window.Show(True)

    app.MainLoop()

def sysAndKeywordInfo():
    import sys
    import keyword

    print "Python version: ", sys.version_info
    print "Python keywords: ", keyword.kwlist

    pass


sysAndKeywordInfo()
